
<template>
	<!-- 考勤管理-晨检 -->
	<div style="width:100%;">
		<el-row :gutter="10" style="margin-top:0.1rem;">
			<el-col :span="4">
				<el-select style="width:100%;" v-model="searchParam.year"></el-select>
			</el-col>
			<el-col :span="4">
				<el-select placeholder="所有班级" style="width:100%;" v-model="searchParam.date"></el-select>
			</el-col>
			<el-col :span="4">
				<el-input placeholder="搜索 学员姓名" v-model="searchParam.ketword"></el-input>
			</el-col>
			<el-col :span="2">
				<el-button>搜索</el-button>
			</el-col>
			<el-col :span="10" style="text-align:right;">
				<el-button @click="importPopup.visible=true">导入晨检数据</el-button>
			</el-col>
		</el-row>
		<table class="table" cellspacing="0" style="width: 100%;margin-top:0.1rem;">
			<thead class="thead">
				<tr>
					<td style="width: 5%;"></td>
					<td style="width: 10%;">姓名</td>
					<td style="width: 20%;">班级名称</td>
					<td style="width: 10%;">晨检状态</td>
					<td style="width: 10%;">考勤状态</td>
					<td style="width: 10%;">晨检结果</td>
					<td style="width: 15%;">检查日期</td>
					<td style="width: 10%;">晨检人员</td>
					<td style="width: 10%;">操作</td>
				</tr>
			</thead>
			<tbody class="tbody">
				<tr v-for="(item,index) in tableList" :key="index">
					<td>
						<el-checkbox v-model="item.checked"></el-checkbox>
					</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td>
						<el-button type="text" @click="signMCheckPopup.visible=true">记录</el-button>
						<el-button type="text">详情</el-button>
					</td>
				</tr>
			</tbody>
		</table>
		<el-row>
			<el-col :span="4" style="padding-top: 0.15rem;">
				<el-checkbox v-model="checkAll"></el-checkbox>
				<el-button @click="visibleSignBatchPopup(true)">批量记录晨检</el-button>
			</el-col>
			<el-col :span="20">
				<el-pagination
					class="page"
					layout="total, sizes, prev, pager, next, jumper"
					:current-page="searchParam.currPage"
					@size-change="pageSizeChange"
					@current-change="curPageChange"
					:total="searchParam.total"
				></el-pagination>
			</el-col>
			
		</el-row>

		<el-dialog
			:title="signMCheckPopup.title"
			:visible.sync="signMCheckPopup.visible"
			:close-on-click-modal="false"
			width="40%">
				<signMCheck ref="signMCheck"></signMCheck>
		</el-dialog>
		<el-dialog
			:title="signMCheckBatchPopup.title"
			:visible.sync="signMCheckBatchPopup.visible"
			:close-on-click-modal="false"
			width="40%">
				<signMCheckBatch ref="signMCheckBatch"></signMCheckBatch>
		</el-dialog>
		<el-dialog
			title="导入"
			:visible.sync="importPopup.visible"
			:close-on-click-modal="false"
			width="30%">
				<mcheckImport ref="mcheckImport"></mcheckImport>
		</el-dialog>
	</div>
</template>

<script>
	import signMCheck from './attendance_mcheck_sign'
	import signMCheckBatch from './attendance_mcheck_signbatch'
	import mcheckImport from './attendance_mcheck_import'
	export default{
		components:{signMCheck,signMCheckBatch,mcheckImport},
		data(){
			return {
				searchParam:{
					year:'',
					date:'',
					keywords:'',
					currPage:1,
					total:0
				},
				tableList:[{}],
				checkAll:false,
				signMCheckPopup:{
					title:'记录晨检信息',
					visible:false
				},
				signMCheckBatchPopup:{
					title:'批量记录晨检信息',
					visible:false
				},
				importPopup:{
					visible:false
				},
			}
		},
		methods:{
			campusChange : function(campusId) { //校区改变
				
			},
			init(){

			},
			pageSizeChange(val){
				this.searchParam.pageSize=val;
				this.search(1);
			},
			curPageChange(val){
				this.search(val);
			},
			search(pIndex){
				this.searchParam.currPage=pIndex||this.searchParam.currPage;

			},

			visibleSignBatchPopup(val){
				this.signMCheckBatchPopup.visible=val;
				if(!val)return;

				let studentlist=[];
				if(this.$refs['signMCheckBatch']){
					this.$refs['signMCheckBatch'].init(studentlist);
				}
				else{
					this.$nextTick(()=>{
						this.$refs['signMCheckBatch'].init(studentlist);
					})
				}
			},
		},
		mounted(){
			
		},
		computed:{
			
		},
		watch:{

		}
	}
</script>

<style lang="scss" scoped>
	
	

	/*自定义滚动条样式*/
	// .box-tasks::-webkit-scrollbar {
	// 	// height: 0.08rem;
	// 	width: 0.05rem;
	// }
	// .box-tasks::-webkit-scrollbar-thumb {
	// 	border-radius: 0.5rem;
	// 	background: #BBBBBB;
	// }
	// .box-tasks::-webkit-scrollbar-track {
	// 	background: rgba(242, 246, 252, 0);
	// }	

	
</style>
<style scoped src="@/style/module/table.css"></style>